// pages/photo-list/photo-list.js
import { Photo } from '../photo/photo-model.js';
var photo = new Photo();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var id = options.id;
    this.data.id = id;
    var mine = options.mine;
    this.data.mine = mine;
    this._loadData();
  },

  _loadData: function () {
    var that = this;
    photo.getPotoList(this.data.id, (res) => {
      console.log(res);
      that.setData({
        loadingHidden: true,
        photoList: res
      })
    })  
  },

  

  photoTap: function(e) {
    var id = photo.getDataSet(e, 'id');
    wx.navigateTo({
      url: '../photo/photo?id=' + id,
    })
  }
})